package com.gy.training;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.gy.training.ui.CitySpinnerActivity;
import com.gy.training.ui.FruitListActivity;
import com.gy.training.ui.LoginActivity;
import com.gy.training.ui.SMSActivity;
import com.gy.training.ui.UploadPicActivity;
import com.gy.training.ui.WiFiMgrActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class MainActivity extends AppCompatActivity {
    @BindView(R.id.go_to_list_view)    Button goListView;
    @BindView(R.id.go_to_receiver)      Button go_to_receiver;
    @BindView(R.id.to_upload_pic)       Button to_upload_pic;
    @BindView(R.id.go_to_spiner)        Button go_to_spiner;
    @BindView(R.id.go_to_login)         Button go_to_login;
    @BindView(R.id.go_wifi_switch)      Button go_to_wifi;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(MainActivity.this);
    }


    @OnClick({R.id.go_to_receiver,R.id.go_to_list_view,R.id.to_upload_pic, R.id.go_to_spiner,R.id.go_to_login,R.id.go_wifi_switch})
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()){
            case R.id.go_to_receiver:
                intent.setClass(MainActivity.this,SMSActivity.class);
                startActivity(intent);
                break;
            case R.id.go_to_list_view:
                intent .setClass(MainActivity.this, FruitListActivity.class);
                startActivity(intent);
                break;
            case R.id.to_upload_pic:
                intent.setClass(MainActivity.this, UploadPicActivity.class);
                startActivity(intent);
                break;
            case R.id.go_to_spiner:
                intent.setClass(MainActivity.this, CitySpinnerActivity.class);
                startActivity(intent);
                break;
            case R.id.go_to_login:
                intent.setClass(MainActivity.this,LoginActivity.class);
                startActivity(intent);
                break;
            case R.id.go_wifi_switch:
                intent.setClass(MainActivity.this, WiFiMgrActivity.class);
                startActivity(intent);
                break;
            default:break;
        }
    }
}